﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/MasterPage.master" AutoEventWireup="true"
    CodeFile="Holiday.aspx.cs" Inherits="BaseInfoManagement_BUInfoMaintain" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style>
        .modalPopup
        {
            background-color: #FAD817;
            border-width: 3px;
            border-style: solid;
            border-color: Gray;
            padding: 3px;
            width: 250px;
        }
        .modalBackground
        {
            filter: alpha(opacity=70);
            opacity: 0.7;
        }
    </style>
    <script src="../Themes/Js/checkItem.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript" src="../Themes/MyCalendar/WdatePicker.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TabTitle" runat="Server">
    <asp:Literal runat="server" ID="title" Text="<%$ Resources:Resource,VacationInfoManagement %>"></asp:Literal>
    <%--休假信息管理--%>
    <asp:LinkButton ID="btn_Add" runat="server" Text=" <%$ Resources:Resource,btnAdd %> "
        OnClientClick="return Add();" />
    <%--添 加--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server">
    <div style="width: 100%;">
        <div class="GridDivCss">
            <IMC:GridView ID="gvHoliday" runat="server" AllowPaging="true" AllowSorting="true"
                PageSize="10" DataSourceID="holidayDateSource" OnRowCommand="gvHoliday_RowCommand">
                <Columns>
                    <asp:TemplateField HeaderText="<%$ Resources:Resource, VacationDate%>" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80px">
                        <%--休假日期--%>
                        <ItemTemplate>
                            &nbsp;<asp:Label ID="lbMounterType" runat="server" Text='<%#ConvertDateType.DateTryFormat(Eval("HolidayDate")) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Resources:Resource,VacationDescription %>" ItemStyle-HorizontalAlign="Center">
                        <%--休假描述--%>
                        <ItemTemplate>
                            &nbsp;<asp:Label ID="lbMounterAbility" runat="server" Text='<%#Eval("Discrib") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Resources:Resource,Modifier %>" ItemStyle-HorizontalAlign="Center">
                        <%--修改人--%>
                        <ItemTemplate>
                            &nbsp;
                            <asp:Label ID="lblModifyPerson" runat="server" Text='<%#Eval("ModifyPerson") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Resources:Resource,ModifyTime %>" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="120px">
                        <%--修改时间--%>
                        <ItemTemplate>
                            &nbsp;<asp:Label ID="lblModifyTime" runat="server" Text='<%#ConvertDateType.DateTimeTryFormat(Eval("ModifyTime")) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Resources:Resource,Operating %>" ItemStyle-HorizontalAlign="Center"
                        ItemStyle-Width="65px">
                        <%--操 作--%>
                        <ItemTemplate>
                            <a href="#" onclick="Upd('<%#ConvertDateType.DateTryFormat( Eval("HolidayDate")) %>','<%#Eval("Discrib") %>')">
                                <%= Resources.Resource.btnMaintain%>
                            </a>
                            <%--修改--%>
                            <asp:LinkButton ID="lbtnDel1" runat="server" CommandName="Del" ValidationGroup="DelMassnahme"
                                CommandArgument='<%#Eval("HolidayDate")%>' OnClientClick="return isDel()"><%= Resources.Resource.btnDel%></asp:LinkButton>
                            <%--删除--%>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </IMC:GridView>
            <asp:ObjectDataSource ID="holidayDateSource" runat="server" TypeName="HolidayDataSource"
                SelectMethod="Select"></asp:ObjectDataSource>
        </div>
        <div style="text-align: center; padding-top: 10px;">
            <input id="btnVendorContactOK" type="button" class="buttonbgYellow" value="<%$ Resources:Resource,btnOK %>"
                onclick="Closed()" runat="server" visible="false" />
            <%--确 定--%>
            <input id="btnVendorContactCancel" type="button" class="buttonbgYellow" value="<%$ Resources:Resource,btnClear %>"
                onclick="Closed()" runat="server" visible="false" />
            <%--取 消--%>
        </div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <input id="btnPreview" runat="server" type="button" value="预览" cssclass="buttonbgtwo"
            style="display: none;" />
        <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server" TargetControlID="btnPreview"
            PopupControlID="Panel1" BackgroundCssClass="modalBackground" CancelControlID="btnCancel"
            DropShadow="true" PopupDragHandleControlID="Panel3" />
        <asp:Panel ID="Panel1" runat="server" Width="650px" CssClass="modalPopup" Style="display: none">
            <asp:Panel ID="Panel3" runat="server" Style="cursor: move; background-color: #DDDDDD;
                border: solid 1px Gray; color: Black">
                <div class="tagdivhead" style="background-color: #D6E0EE; padding-top: 8px">
                    <div class="divcenter">
                        <span>&nbsp;<asp:Label ID="lbtitle" runat="server" CssClass="querytextCss" Width="150px"
                            Height="16px"></asp:Label>
                        </span>
                    </div>
                </div>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ModifytableCss">
                    <tr>
                        <td colspan="4" style="height: 1px">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="querytexttdCss" style="width: 20%">
                            <%= Resources.Resource.VacationDate%><%--休假时间--%>
                        </td>
                        <td class="querycoltdCss" style="width: 30%">
                            <input type="text" id="txt_HolidayDate" runat="server" class="Wdate" style="width: 120px"
                                onfocus="WdatePicker({isShowClear:false,dateFmt:'yyyy-MM-dd'})" /><asp:RequiredFieldValidator
                                    runat="server" ID="RequiredFieldValidator1" ControlToValidate="txt_HolidayDate"
                                    ErrorMessage="*" Text="*" ValidationGroup="999"></asp:RequiredFieldValidator>
                        </td>
                        <td class="querytexttdCss" style="width: 20%">
                            <%= Resources.Resource.VacationDescription%><%--休假描述--%>
                        </td>
                        <td class="querycoltdCss" style="width: 30%">
                            <asp:TextBox ID="txt_Discrib" runat="server" MaxLength="45" Width="120px"></asp:TextBox><asp:RequiredFieldValidator
                                runat="server" ID="RequiredFieldValidator2" ControlToValidate="txt_Discrib" ErrorMessage="*"
                                Text="*" ValidationGroup="999"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="height: 1px">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="padding-bottom: 3; padding-top: 3;">
                            <asp:Button ID="btn_Save" runat="server" Text="<%$ Resources:Resource,btnSave%> "
                                ValidationGroup="999" OnClick="btn_Save_Click" />
                            <%--保 存--%>
                            &nbsp;&nbsp;&nbsp;<asp:Button ID="btnCancel" runat="server" Text="<%$ Resources:Resource,btnClear%>" />
                            <%--取 消--%>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="height: 1px">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </asp:Panel>
    </div>
    <script type="text/javascript">
        function Add() {
            document.getElementById("<%= txt_HolidayDate.ClientID%>").value = "";
            document.getElementById("<%= txt_Discrib.ClientID%>").value = "";

            document.getElementById('<%= btnPreview.ClientID%>').click();
            return false;
        }


        function Upd(holiday, discrib) {
            document.getElementById("<%= txt_HolidayDate.ClientID%>").value = holiday;
            document.getElementById("<%= txt_Discrib.ClientID%>").value = discrib;

            document.getElementById('<%= btnPreview.ClientID%>').click();
            return false;
            return false;

        }
        function Closed() {
            window.opener = null; window.close();
        }
        function isDel() {
            return confirm('<%=Resources.Resource.IsDelete %>');
        }
    </script>
</asp:Content>
